<script setup>
import { ref } from 'vue'
import { ElMessage } from 'element-plus'

const userForm = ref({
  username: '张三',
  email: 'zhangsan@example.com',
  phone: '13800138000'
})

const handleSubmit = () => {
  // 这里添加保存个人信息的逻辑
  ElMessage.success('个人信息更新成功')
}
</script>

<template>
  <div class="profile-container">
    <h2>个人中心</h2>
    <el-form :model="userForm" label-width="100px" class="profile-form">
      <el-form-item label="用户名">
        <el-input v-model="userForm.username" />
      </el-form-item>
      <el-form-item label="邮箱">
        <el-input v-model="userForm.email" />
      </el-form-item>
      <el-form-item label="手机号">
        <el-input v-model="userForm.phone" />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="handleSubmit">保存修改</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<style scoped>
.profile-container {
  padding: 20px;
  background: #fff;
  border-radius: 4px;
}

.profile-form {
  max-width: 500px;
  margin-top: 20px;
}
</style> 